package com.wkbb.sports.service.impl;

import com.wkbb.common.base.BaseServiceImpl;
import com.wkbb.sports.dto.TeachFileDto;
import com.wkbb.sports.mapper.HlifeTeachPlanMapper;
import com.wkbb.sports.mapper.LekangMapper;
import com.wkbb.sports.mapper.TeachFileMapper;
import com.wkbb.sports.model.LekangLogon;
import com.wkbb.sports.model.LekangTest;
import com.wkbb.sports.service.LekangService;
import com.wkbb.sports.service.TeachFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class LekangServiceImpl extends BaseServiceImpl<LekangTest> implements LekangService {

    @Autowired
    LekangMapper lekangMapper;
    @Autowired
    public void setMapper(LekangMapper mapper) {
        super.setMapper(mapper);
    }

    @Override
    public void putLekangLogon(LekangLogon lekangLogon) {
        //查找未结束测试的登录情况
        LekangLogon logon = lekangMapper.findLogon(lekangLogon);
        if (logon == null){
            lekangMapper.insertLogon(lekangLogon);
        }else{
            lekangMapper.updateLogon(logon);
        }
    }
}
